# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.OSConfig.V1.Model.OSPolicyResourceFile do
  @moduledoc """
  A remote or local file.

  ## Attributes

  *   `allowInsecure` (*type:* `boolean()`, *default:* `nil`) - Defaults to false. When false, files are subject to validations based on the file type: Remote: A checksum must be specified. Cloud Storage: An object generation number must be specified.
  *   `gcs` (*type:* `GoogleApi.OSConfig.V1.Model.OSPolicyResourceFileGcs.t`, *default:* `nil`) - A Cloud Storage object.
  *   `localPath` (*type:* `String.t`, *default:* `nil`) - A local path within the VM to use.
  *   `remote` (*type:* `GoogleApi.OSConfig.V1.Model.OSPolicyResourceFileRemote.t`, *default:* `nil`) - A generic remote file.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :allowInsecure => boolean() | nil,
          :gcs => GoogleApi.OSConfig.V1.Model.OSPolicyResourceFileGcs.t() | nil,
          :localPath => String.t() | nil,
          :remote => GoogleApi.OSConfig.V1.Model.OSPolicyResourceFileRemote.t() | nil
        }

  field(:allowInsecure)
  field(:gcs, as: GoogleApi.OSConfig.V1.Model.OSPolicyResourceFileGcs)
  field(:localPath)
  field(:remote, as: GoogleApi.OSConfig.V1.Model.OSPolicyResourceFileRemote)
end

defimpl Poison.Decoder, for: GoogleApi.OSConfig.V1.Model.OSPolicyResourceFile do
  def decode(value, options) do
    GoogleApi.OSConfig.V1.Model.OSPolicyResourceFile.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.OSConfig.V1.Model.OSPolicyResourceFile do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
